﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="search.aspx.cs" Inherits="NSX07.search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="center_title_bar">Result search</div>
    <asp:DataList ID="SearchProductDataList" runat="server" DataKeyField="id" 
    DataSourceID="SearchProductDataSource" RepeatColumns="3">
        <ItemTemplate>
        <div class="prod_box">
            <div class="center_prod_box">
                <div class="product_title">
                    <a href="productdetails.aspx?id=<%#Eval("id") %>"> <asp:Label ID="Label1" runat="server" Text='<%# Eval("name") %>' /></a>
                </div>
                <div class="product_img">
                    <a href="productdetails.aspx?id=<%#Eval("id") %>"><img border="0"  alt="" src='<%# Eval("imageUrl") %>' width="100" height="140"></a>
                </div>
                <div class="prod_price">
                    price: $<span class="price"><%# Eval("price") %></span>
                </div> 
            </div>
            <div class="prod_details_tab">
                <a class="prod_buy" href="">Add to Cart</a>
                <a class="prod_details" href="productdetails.aspx?id=<%#Eval("id") %>"">Details</a>
            </div>
        </div>
        </ItemTemplate>
    </asp:DataList>
<asp:ObjectDataSource ID="SearchProductDataSource" runat="server" 
    DeleteMethod="Delete" InsertMethod="Insert" 
    OldValuesParameterFormatString="original_{0}" 
    SelectMethod="GetSearchProductByKeyWord" 
    TypeName="NSX07.App_Code.MyDalLayerTableAdapters.ProductTableAdapter" 
    UpdateMethod="Update">
    <DeleteParameters>
        <asp:Parameter Name="Original_id" Type="Int32" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="name" Type="String" />
        <asp:Parameter Name="imageUrl" Type="String" />
        <asp:Parameter Name="description" Type="String" />
        <asp:Parameter Name="idCategory" Type="Int32" />
        <asp:Parameter Name="stock" Type="Int32" />
        <asp:Parameter Name="price" Type="Double" />
        <asp:Parameter Name="Author" Type="String" />
        <asp:Parameter Name="publishDate" Type="DateTime" />
        <asp:Parameter Name="Original_id" Type="Int32" />
    </UpdateParameters>
    <SelectParameters>
        <asp:QueryStringParameter Name="keyWord" QueryStringField="name" 
            Type="String" />
    </SelectParameters>
    <InsertParameters>
        <asp:Parameter Name="name" Type="String" />
        <asp:Parameter Name="imageUrl" Type="String" />
        <asp:Parameter Name="description" Type="String" />
        <asp:Parameter Name="idCategory" Type="Int32" />
        <asp:Parameter Name="stock" Type="Int32" />
        <asp:Parameter Name="price" Type="Double" />
        <asp:Parameter Name="Author" Type="String" />
        <asp:Parameter Name="publishDate" Type="DateTime" />
    </InsertParameters>
</asp:ObjectDataSource>
</asp:Content>
